﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Derbster.Domain
{
    public class League
    {
        [ContractVerification(false)]
        internal League()
        {
            
        }

        public League(string name)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(name));
            Name = name;
        }

        public League(string name, string location)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(name));
            Contract.Requires(!String.IsNullOrWhiteSpace(location));
            Name = name;
            Location = location;
        }

        [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int LeagueId { get; internal set; }
        public string Name { get; internal set; }
        public string Location { get; internal set; }

        public HashSet<Team> Teams { get; internal set; } 
  
    }
}
